const connection = require("../config/mysql")

class CommentService {
    async update(content, momentId, userId) {
        const statement = "INSERT INTO comment (id,content,moment_id,user_id) VALUES (REPLACE(UUID(), '-', ''), ?, ?, ?);"
        const [result] = await connection.execute(statement, [content, momentId, userId])
        try {
            return result
        } catch (error) {
            console.log(error);
        }
    }
}

module.exports = new CommentService()